<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Tree::Visitors::Convert</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (C)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Tree.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree.html" title="Sass::Tree (module)">Tree</a></span> &raquo; <span class='title'><a href="Visitors.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors.html" title="Sass::Tree::Visitors (module)">Visitors</a></span>
     &raquo; 
    <span class="title">Convert</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Tree::Visitors::Convert 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Base.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Base.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></li>
          
            <li class="next">Sass::Tree::Visitors::Convert</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A visitor for converting a Sass tree into a source string.</p>

  </div>
</div>
<div class="tags">
  
</div>
  <h2>Constant Summary</h2>
  


  
  
  
  

  <h2>Class Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#visit-class_method" title="visit (class method)">+ (String) <strong>visit</strong>(root, options, format) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Runs the visitor on a tree.</span>
  
</li>

    
  </ul>

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Convert) <strong>initialize</strong>(options, format) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">A new instance of Convert.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_charset-instance_method" title="#visit_charset (instance method)">- <strong>visit_charset</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_children-instance_method" title="#visit_children (instance method)">- <strong>visit_children</strong>(parent) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_comment-instance_method" title="#visit_comment (instance method)">- <strong>visit_comment</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_content-instance_method" title="#visit_content (instance method)">- <strong>visit_content</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_cssimport-instance_method" title="#visit_cssimport (instance method)">- <strong>visit_cssimport</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_debug-instance_method" title="#visit_debug (instance method)">- <strong>visit_debug</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_directive-instance_method" title="#visit_directive (instance method)">- <strong>visit_directive</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_each-instance_method" title="#visit_each (instance method)">- <strong>visit_each</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_extend-instance_method" title="#visit_extend (instance method)">- <strong>visit_extend</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_for-instance_method" title="#visit_for (instance method)">- <strong>visit_for</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_function-instance_method" title="#visit_function (instance method)">- <strong>visit_function</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_if-instance_method" title="#visit_if (instance method)">- <strong>visit_if</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_import-instance_method" title="#visit_import (instance method)">- <strong>visit_import</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_media-instance_method" title="#visit_media (instance method)">- <strong>visit_media</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_mixin-instance_method" title="#visit_mixin (instance method)">- <strong>visit_mixin</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_mixindef-instance_method" title="#visit_mixindef (instance method)">- <strong>visit_mixindef</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_prop-instance_method" title="#visit_prop (instance method)">- <strong>visit_prop</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_return-instance_method" title="#visit_return (instance method)">- <strong>visit_return</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_root-instance_method" title="#visit_root (instance method)">- <strong>visit_root</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Ensures proper spacing between top-level nodes.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_rule-instance_method" title="#visit_rule (instance method)">- <strong>visit_rule</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_supports-instance_method" title="#visit_supports (instance method)">- <strong>visit_supports</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_variable-instance_method" title="#visit_variable (instance method)">- <strong>visit_variable</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_warn-instance_method" title="#visit_warn (instance method)">- <strong>visit_warn</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_while-instance_method" title="#visit_while (instance method)">- <strong>visit_while</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Base.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></h3>
  <p class="inherited"><a href="Base.html#node_name-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html#node_name-instance_method" title="Sass::Tree::Visitors::Base#node_name (method)">#node_name</a>, <a href="Base.html#visit-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html#visit-instance_method" title="Sass::Tree::Visitors::Base#visit (method)">#visit</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Tree::Visitors::Convert (class)">Convert</a></tt>) <strong>initialize</strong>(options, format)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of Convert</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


15
16
17
18
19
20
21</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 15</span>

def initialize(options, format)
  @options = options
  @format = format
  @tabs = 0
  # 2 spaces by default
  @tab_chars = @options[:indent] || "  "
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="visit-class_method">
  
    + (<tt>String</tt>) <strong>visit</strong>(root, options, format) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Runs the visitor on a tree.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a></tt>)</span>
      
      
        <span class='name'>root</span>
      
      
      
        &mdash;
        The root node of the Sass tree.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
      
      
        <span class='name'>options</span>
      
      
      
        &mdash;
        An options hash (see <tt><a href="CSS.html#initialize-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/CSS.html#initialize-instance_method" title="Sass::CSS#initialize (method)">Sass::CSS#initialize</a></tt>).
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>Symbol</tt>)</span>
      
      
        <span class='name'>format</span>
      
      
      
        &mdash;
        <code>:sass</code> or <code>:scss</code>.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
        &mdash;
        The Sass or SCSS source for the tree.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 9</span>

def self.visit(root, options, format)
  new(options, format).send(:visit, root)
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="visit_charset-instance_method">
  
    - <strong>visit_charset</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


49
50
51</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 49</span>

def visit_charset(node)
  "#{tab_str}@charset \"#{node.name}\"#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_children-instance_method">
  
    - <strong>visit_children</strong>(parent)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


23
24
25
26
27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 23</span>

def visit_children(parent)
  @tabs += 1
  return @format == :sass ? "\n" : " {}\n" if parent.children.empty?
  (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : "\n#{ @tab_chars * (@tabs-1)}}\n")
ensure
  @tabs -= 1
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_comment-instance_method">
  
    - <strong>visit_comment</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 53</span>

def visit_comment(node)
  value = interp_to_src(node.value)
  content = if @format == :sass
    content = value.gsub(/\*\/$/, '').rstrip
    if content =~ /\A[ \t]/
      # Re-indent SCSS comments like this:
      #     /* foo
      #   bar
      #       baz */
      content.gsub!(/^/, '   ')
      content.sub!(/\A([ \t]*)\/\*/, '/*\1')
    end

    content =
      unless content.include?("\n")
        content
      else
        content.gsub!(/\n( \*|\/\/)/, "\n  ")
        spaces = content.scan(/\n( *)/).map {|s| s.first.size}.min
        sep = node.type == :silent ? "\n//" : "\n *"
        if spaces >= 2
          content.gsub(/\n  /, sep)
        else
          content.gsub(/\n#{' ' * spaces}/, sep)
        end
      end

    content.gsub!(/\A\/\*/, '//') if node.type == :silent
    content.gsub!(/^/, tab_str)
    content.rstrip + "\n"
  else
    spaces = (@tab_chars * [@tabs - value[/^ */].size, 0].max)
    content = if node.type == :silent
      value.gsub(/^[\/ ]\*/, '//').gsub(/ *\*\/$/, '')
    else
      value
    end.gsub(/^/, spaces) + "\n"
    content
  end
  content.sub!(%r{^\s*(/\*)}, '/*!') if node.type == :loud #'
  content
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_content-instance_method">
  
    - <strong>visit_content</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


211
212
213</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 211</span>

def visit_content(node)
  "#{tab_str}@content#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_cssimport-instance_method">
  
    - <strong>visit_cssimport</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


162
163
164
165
166
167
168
169
170</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 162</span>

def visit_cssimport(node)
  if node.uri.is_a?(Sass::Script::Node)
    str = "#{tab_str}@import #{node.uri.to_sass(@options)}"
  else
    str = "#{tab_str}@import #{node.uri}"
  end
  str << " #{interp_to_src(%22node.query%22 tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/node.query")}" unless node.query.empty?
  "#{str}#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_debug-instance_method">
  
    - <strong>visit_debug</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


96
97
98</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 96</span>

def visit_debug(node)
  "#{tab_str}@debug #{node.expr.to_sass(@options)}#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_directive-instance_method">
  
    - <strong>visit_directive</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


100
101
102
103
104
105</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 100</span>

def visit_directive(node)
  res = "#{tab_str}#{interp_to_src(node.value)}"
  res.gsub!(/^@import \#\{(.*)\}([^}]*)$/, '@import \1\2');
  return res + "#{semi}\n" unless node.has_children
  res + yield + "\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_each-instance_method">
  
    - <strong>visit_each</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


107
108
109</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 107</span>

def visit_each(node)
  "#{tab_str}@each $#{dasherize(node.var)} in #{node.list.to_sass(@options)}#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_extend-instance_method">
  
    - <strong>visit_extend</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


111
112
113</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 111</span>

def visit_extend(node)
  "#{tab_str}@extend #{selector_to_src(node.selector).lstrip}#{semi}#{" !optional" if node.optional?}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_for-instance_method">
  
    - <strong>visit_for</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


115
116
117
118</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 115</span>

def visit_for(node)
  "#{tab_str}@for $#{dasherize(node.var)} from #{node.from.to_sass(@options)} " +
    "#{node.exclusive ? "to" : "through"} #{node.to.to_sass(@options)}#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_function-instance_method">
  
    - <strong>visit_function</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


120
121
122
123
124
125
126
127
128
129
130</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 120</span>

def visit_function(node)
  args = node.args.map do |v, d|
    d ? "#{v.to_sass(@options)}: #{d.to_sass(@options)}" : v.to_sass(@options)
  end.join(", ")
  if node.splat
    args << ", " unless node.args.empty?
    args << node.splat.to_sass(@options) << "..."
  end

  "#{tab_str}@function #{dasherize(node.name)}(#{args})#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_if-instance_method">
  
    - <strong>visit_if</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 132</span>

def visit_if(node)
  name =
    if !@is_else; "if"
    elsif node.expr; "else if"
    else; "else"
    end
  @is_else = false
  str = "#{tab_str}@#{name}"
  str << " #{node.expr.to_sass(@options)}" if node.expr
  str << yield
  @is_else = true
  str << visit(node.else) if node.else
  str
ensure
  @is_else = false
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_import-instance_method">
  
    - <strong>visit_import</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


149
150
151
152</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 149</span>

def visit_import(node)
  quote = @format == :scss ? '"' : ''
  "#{tab_str}@import #{quote}#{node.imported_filename}#{quote}#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_media-instance_method">
  
    - <strong>visit_media</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


154
155
156</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 154</span>

def visit_media(node)
  "#{tab_str}@media #{media_interp_to_src(node.query)}#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_mixin-instance_method">
  
    - <strong>visit_mixin</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


197
198
199
200
201
202
203
204
205
206
207
208
209</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 197</span>

def visit_mixin(node)
  unless node.args.empty? && node.keywords.empty? && node.splat.nil?
    args = node.args.map {|a| a.to_sass(@options)}.join(", ")
    keywords = Sass::Util.hash_to_a(node.keywords).
      map {|k, v| "$#{dasherize(k)}: #{v.to_sass(@options)}"}.join(', ')
    if node.splat
      splat = (args.empty? && keywords.empty?) ? "" : ", "
      splat = "#{splat}#{node.splat.to_sass(@options)}..."
    end
    arglist = "(#{args}#{', ' unless args.empty? || keywords.empty?}#{keywords}#{splat})"
  end
  "#{tab_str}#{@format == :sass ? '+' : '@include '}#{dasherize(node.name)}#{arglist}#{node.has_children ? yield : semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_mixindef-instance_method">
  
    - <strong>visit_mixindef</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 172</span>

def visit_mixindef(node)
  args =
    if node.args.empty? && node.splat.nil?
      ""
    else
      str = '('
      str << node.args.map do |v, d|
        if d
          "#{v.to_sass(@options)}: #{d.to_sass(@options)}"
        else
          v.to_sass(@options)
        end
      end.join(", ")

      if node.splat
        str << ", " unless node.args.empty?
        str << node.splat.to_sass(@options) << '...'
      end

      str << ')'
    end

  "#{tab_str}#{@format == :sass ? '=' : '@mixin '}#{dasherize(node.name)}#{args}#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_prop-instance_method">
  
    - <strong>visit_prop</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


215
216
217
218
219</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 215</span>

def visit_prop(node)
  res = tab_str + node.declaration(@options, @format)
  return res + semi + "\n" if node.children.empty?
  res + yield.rstrip + semi + "\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_return-instance_method">
  
    - <strong>visit_return</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


221
222
223</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 221</span>

def visit_return(node)
  "#{tab_str}@return #{node.expr.to_sass(@options)}#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_root-instance_method">
  
    - <strong>visit_root</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Ensures proper spacing between top-level nodes.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 32</span>

def visit_root(node)
  Sass::Util.enum_cons(node.children + [nil], 2).map do |child, nxt|
    visit(child) +
      if nxt &&
          (child.is_a?(Sass::Tree::CommentNode) &&
            child.line + child.lines + 1 == nxt.line) ||
          (child.is_a?(Sass::Tree::ImportNode) && nxt.is_a?(Sass::Tree::ImportNode) &&
            child.line + 1 == nxt.line) ||
          (child.is_a?(Sass::Tree::VariableNode) && nxt.is_a?(Sass::Tree::VariableNode) &&
            child.line + 1 == nxt.line)
        ""
      else
        "\n"
      end
  end.join.rstrip + "\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_rule-instance_method">
  
    - <strong>visit_rule</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


225
226
227
228
229
230
231
232
233
234
235
236
237
238
239</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 225</span>

def visit_rule(node)
  if @format == :sass
    name = selector_to_sass(node.rule)
    name = "\\" + name if name[0] == ?:
    name.gsub(/^/, tab_str) + yield
  elsif @format == :scss
    name = selector_to_scss(node.rule)
    res = name + yield
    if node.children.last.is_a?(Sass::Tree::CommentNode) && node.children.last.type == :silent
      res.slice!(-3..-1)
      res << "\n" << tab_str << "}\n"
    end
    res
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_supports-instance_method">
  
    - <strong>visit_supports</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


158
159
160</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 158</span>

def visit_supports(node)
  "#{tab_str}@#{node.name} #{node.condition.to_src(@options)}#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_variable-instance_method">
  
    - <strong>visit_variable</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


241
242
243</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 241</span>

def visit_variable(node)
  "#{tab_str}$#{dasherize(node.name)}: #{node.expr.to_sass(@options)}#{' !default' if node.guarded}#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_warn-instance_method">
  
    - <strong>visit_warn</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


245
246
247</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 245</span>

def visit_warn(node)
  "#{tab_str}@warn #{node.expr.to_sass(@options)}#{semi}\n"
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_while-instance_method">
  
    - <strong>visit_while</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


249
250
251</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/convert.rb', line 249</span>

def visit_while(node)
  "#{tab_str}@while #{node.expr.to_sass(@options)}#{yield}"
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:47 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>